<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="ckeditor/ckeditor.js"></script>
<link href="ckeditor/sample.css" rel="stylesheet">
<script type="text/javascript">
function loadXMLDoc(str)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","User-checkName?user.name="+str,true);
xmlhttp.send();
}

var editor = null;
window.onload = function() {
    editor = CKEDITOR.replace( 'user.notes', {
    
        on: {
            instanceReady: function( ev ) {
                this.dataProcessor.writer.setRules( 'p', {
                    indent: false,
                    breakBeforeOpen: false,   //<p>之前不加换行
                    breakAfterOpen: false,    //<p>之后不加换行
                    breakBeforeClose: false,  //</p>之前不加换行
                    breakAfterClose: false    //</p>之后不加换行7
                });
            }
        }
    });
};
</script>
</head>
<body>
	<form action="User-update" method="post">
		<table>
			
			<tr>
				<td><input type="hidden" name="user.id"  value="<s:property value='user.id' />"> 
				戶主姓名:</td>
				<td><input name="user.name" type="text" onblur="loadXMLDoc(this.value)" value="<s:property value='user.name' />"></td>
			</tr>
			<tr>
				<td>地址:</td>
				<td><input
			name="user.address" type="text"  value="<s:property value='user.address' />"></td>
			</tr>
			<tr>
				<td>联系电话:</td>
				<td><input
			name="user.phone" type="text"  value="<s:property value='user.phone' />"></td>
			</tr>
			<tr>
				<td>用户类型:</td>
				<td><s:select name="user.userType" list="@com.zcg.gasmanager.model.TYPE@values()" listKey="name()" listValue="toString()" theme="simple"/>
				</td>
			</tr>
				
			<tr>
					<td>备注</td>
				<td><textarea cols="4" id="editor1" name="user.notes" rows="10" ><s:property value="user.notes" /></textarea>
				</td></tr>
			<tr>
				<td><button type="submit">更新</button></td>
			</tr>
		
		</table>
	</form>
	<a href="User-list">返回</a>
</body>
</html>